@extends('admin.main')
@section('body')
    <div class="main-title">
        <h2>外设列表</h2>
    </div>
    <div id="printer_div">
        <div class="cf">
            <div class="fl">
                <a class="btn" href="{{urlPlat($ctr,'getPrinterEdit')}}">新 增</a>
            </div>
        </div>
        <div class="data-table table-striped">
            <table class="">
                <thead>
                <tr>
                    <th class="">编号</th>
                    <th class="">识别码</th>
                    <th class="">备注名称</th>
                    <th class="">流量卡号码</th>
                    <th class="">状态</th>
                    <th class="">创建时间</th>
                    <th class="">操作</th>
                </tr>
                </thead>
                <tbody>
                    @if(count($rows['data']))
                        @foreach($rows['data'] as $v)
                            <tr>
                                <td>{{$v['serial_number']}}</td>
                                <td>{{$v['auth_code']}}</td>
                                <td>{{$v['desc']}}</td>
                                <td>{{$v['mobile']}}</td>
                                <td>{{$v['status_text']}}</td>
                                <td>{{$v['created_at']}}</td>
                                <td>
                                    @if($v['is_add'] == 0)
                                        <a href="{{urlPlat($ctr,'getPrinterEdit',['id'=>$v['id']])}}"
                                               style="color:green">编辑</a>
                                        <a href="{{urlPlat($ctr,'getPrinterAdd',['id'=>$v['id']])}}"
                                           class="ajax-get" style="color:blue">上传</a>
                                    @endif
                                    @if($v['status'] == 1)
                                        <a href="{{urlPlat($ctr,'anyChangePrinterStatus',['status'=>0,'id'=>$v['id']])}}"
                                           class="ajax-get" style="color:orange">禁用</a>
                                    @else
                                        <a href="{{urlPlat($ctr,'anyChangePrinterStatus',['status'=>1,'id'=>$v['id']])}}"
                                           class="ajax-get" style="color:blue">启用</a>
                                    @endif
                                        <a href="{{urlPlat($ctr,'getPrinterDel',['id'=>$v['id']])}}"
                                           class="ajax-get" style="color:red">删除</a>
                                </td>
                            </tr>
                        @endforeach
                    @else
                        <td colspan="7" class="text-center"> aOh! 暂时还没有内容!</td>
                    @endif
                </tbody>
            </table>
        </div>

        <div class="page">
            @if($rows['last_page']>1)
                <div>
                    @if($rows['prev_page_url'])
                        <a class="prev" href="{{$rows['prev_page_url']}}">&lt;&lt;</a>
                    @endif
                    @if(count($rows['pageNoList']))
                        @foreach($rows['pageNoList'] as $v)
                            @if($rows['current_page'] == $v)
                                <span class="current">{{$v}}</span>
                            @else
                                <a class="num" href="{{urlPlat('single','getGoods',['page'=>$v])}}">{{$v}}</a>
                            @endif
                        @endforeach
                    @endif
                    @if($rows['next_page_url'])
                        <a class="next" href="{{$rows['next_page_url']}}">&gt;&gt;</a>
                    @endif
                    <span class="rows">共 {{$rows['total']}} 条记录</span>
                </div>
            @endif
        </div>
    </div>
@endsection
